<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="common :: common">
    <meta charset="UTF-8">
    <title>信息修改</title>
</head>
<style type="text/css">
    .userpic-myInfo{
        width:60px;
        height:60px;
        border-radius:60px;
        -webkit-border-radius:60px;
        -moz-border-radius:60px;
        border:2px solid #fff;
        box-shadow:0 0 4px #ccc;
        overflow:hidden;
    }
    .el-icon-arrow-right{

    }
</style>
<body>
<div id="app">
    <!--顶部--->
    <mt-header title="我的信息" style="background: linear-gradient(to bottom, #55a160 ,#01603e);">
        <router-link to="/" slot="left" @click="history.back()">
            <mt-button icon="back">返回</mt-button>
        </router-link>
        <mt-button icon="save" slot="right" @click="infoFormSub()">保存</mt-button>
    </mt-header>
    <div style="border-bottom: 1px solid #fcfcfc;font-size: 14px;">
        <form action="" method="post" id="infoForm">
            <!--不可编辑-->
            <mt-cell title="车牌号码">{{infoForm.plateNo}}</mt-cell>
            <mt-cell title="手机号码">{{infoForm.mobile}}</mt-cell>
            <!--可编辑-->
            <mt-field label="姓名" placeholder="姓名" v-model="infoForm.name"></mt-field>
            <mt-field label="身份证号" placeholder="身份证号" v-model="infoForm.idCard"></mt-field>
        </form>
    </div>
    <!--中间-->
</div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data() {
            return{
                infoForm:{
                    id:'',
                    plateNo:'川A200F4',
                    mobile:'16602839457',
                    name:'',
                    idCard:''
                },
                ResUrl:''
            }
        },
        methods: {
            handleClose: function(){
                console.log("返回")
            },
            selected:function(){

            },
            infoFormSub(){
                axios.post("../../user/update",{
                    "id":this.infoForm.id,
                    "plateNo":this.infoForm.plateNo,
                    "mobile":this.infoForm.mobile,
                    "name":this.infoForm.name,
                    "idCard":this.infoForm.idCard
                }).
                then(function(res){
                    alert("success..");
                }).
                catch()
            },
            getInfo(){
                axios.get("../../user/getInfo").
                then(function(res){
                    vm.infoForm.plateNo = res.data.info.plateNo;
                    vm.infoForm.mobile = res.data.info.mobile;
                    vm.infoForm.name = res.data.info.name;
                    vm.infoForm.idCard = res.data.info.idCard;
                }).
                catch()
            },

        },
        created(){
            this.getInfo();
        }
    })
</script>
</html>